home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-09-14 | 864 b | 40 lines | [TEXT/MPS ] |
- # Wild - single wild card command interpreter
- #
- # Command line: Wild command source destination
- # Example: Wild Rename =.TEXT =
- #
- # Parameters:
- # {1} = command
- # {2} = srcfilespec
- # {3} = destfilespec
-
- If {#} < 3
- Echo "# {0} - Not enough parameters were specified."
- Exit
- End
- If {#} > 3
- Echo "# {0} - Too many parameters were specified."
- Exit
- End
- If "{2}" !~ /≈=≈/
- Echo "# {0} - No = was specified in the source file name."
- Exit
- End
- If "{3}" !~ /≈=≈/
- Echo "# {0} - No = was specified in the destination file name."
- Exit
- End
-
- ( Evaluate "{2}" =~ /(≈)®1=(≈)®2/ ) > dev:null
- Set sourcePre "{®1}"
- Set sourcePost "{®2}"
-
- ( Evaluate "{3}" =~ /(≈)®1=(≈)®2/ ) > dev:null
- Set destPre "{®1}"
- Set destPost "{®2}"
-
- For name In "{sourcePre}"≈"{sourcePost}"
- ( Evaluate "{name}" =~ /{sourcePre}(≈)®1{sourcePost}/ ) > dev:null
- {1} "{name}" "{destPre}{®1}{destPost}"
- End
-